﻿// --------------------------------------------------------------------------------------------------------------------
// <copyright file="CategoryWithCount.cs" company="Spenta Consulting">
//   (c) Copyright 2011
// </copyright>
// <summary>
//   Defines the CategoryWithCount type.
// </summary>
// --------------------------------------------------------------------------------------------------------------------

namespace Spenta.StreetCare.Core.Models
{
    using System;
    using System.Runtime.Serialization;

    /// <summary>
    /// Defines the CategoryWithCount type
    /// </summary>
    [Serializable]
    [DataContract(IsReference = true)]
    public class CategoryWithCount : Category
    {
        /// <summary>
        /// Gets or sets a value indicating whether this instance is default.
        /// </summary>
        /// <value>
        ///    <c>true</c> if this instance is default; otherwise, <c>false</c>.
        /// </value>
        [DataMember]
        public bool IsDefault { get; set; }

        /// <summary>
        /// Gets or sets the report count.
        /// </summary>
        /// <value>The report count.</value>
        [DataMember]
        public int ReportCount { get; set; }

        /// <summary>
        /// Gets or sets a value indicating whether the collection is being retrieved or not.
        /// </summary>
        /// <value>The report count.</value>
        [DataMember]
        public bool IsDirty { get; set; }

        /// <summary>
        /// Sets the category.
        /// </summary>
        /// <value>The category.</value>
        public Category Category
        {
            set
            {
                var category = value;
                CategoryCustomerID = category.CategoryCustomerID;
                CategoryDescription = category.CategoryDescription;
                CategoryID = category.CategoryID;
                CategoryImageUrl = category.CategoryImageUrl;
                CategoryKey = category.CategoryKey;
                CategoryTitle = category.CategoryTitle;
                CategoryColor = category.CategoryColor;
            }
        }
    }
}
